<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>游戏设置</title>
    <link rel="stylesheet" th:href="@{/js/lib/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/js/lib/fontawesome/css/all.min.css}">
    <style>
        /* 导航栏样式 */
        .navbar {
            padding: 0.5rem 1rem;
            background: linear-gradient(135deg, #1e88e5, #1565c0);
        }
        
        .navbar-brand {
            font-size: 1.2rem;
            font-weight: 600;
        }

        /* 主体内容样式 */
        body {
            background: #f8f9fa;
            -webkit-tap-highlight-color: transparent;
            padding-bottom: env(safe-area-inset-bottom);
        }

        .settings-container {
            max-width: 800px;
            margin: 2rem auto;
            padding: 20px;
        }

        .settings-card {
            background: white;
            border-radius: 12px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.1);
            margin-bottom: 20px;
            overflow: hidden;
        }

        .settings-card .card-header {
            background: none;
            border-bottom: 1px solid rgba(0,0,0,0.1);
            padding: 15px 20px;
        }

        .settings-card .card-body {
            padding: 20px;
        }

        .settings-title {
            color: #2c3e50;
            font-weight: 500;
            margin-bottom: 0;
        }

        /* 表单控件样式 */
        .form-range {
            width: 100%;
            margin: 10px 0;
        }

        .form-check {
            margin: 15px 0;
        }

        .form-select {
            border-radius: 8px;
            border: 1px solid #dee2e6;
            padding: 8px 12px;
        }

        /* 保存按钮 */
        .save-btn {
            background: linear-gradient(135deg, #1e88e5, #1565c0);
            border: none;
            padding: 10px 25px;
            border-radius: 8px;
            color: white;
            font-weight: 500;
            transition: all 0.3s ease;
            margin-top: 20px;
        }

        .save-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
        }

        /* 响应式设计 */
        @media (max-width: 768px) {
            .settings-container {
                margin: 1rem;
                padding: 15px;
            }
        }
    </style>
    <th:block th:replace="fragments/navbar :: navbar-style"></th:block>
</head>
<body>
    <nav th:replace="fragments/navbar :: navbar('游戏设置', 'fas fa-cog')"></nav>

    <div class="settings-container">
        <!-- 音效设置 -->
        <div class="settings-card">
            <div class="card-header">
                <h5 class="settings-title"><i class="fas fa-volume-up me-2"></i>音效设置</h5>
            </div>
            <div class="card-body">
                <div class="mb-4">
                    <label class="form-label d-flex justify-content-between">
                        背景音乐音量
                        <span id="bgmVolumeValue">50%</span>
                    </label>
                    <input type="range" class="form-range" id="bgmVolume" min="0" max="100" step="1">
                </div>
                <div class="mb-4">
                    <label class="form-label d-flex justify-content-between">
                        音效音量
                        <span id="sfxVolumeValue">50%</span>
                    </label>
                    <input type="range" class="form-range" id="sfxVolume" min="0" max="100" step="1">
                </div>
                <div class="form-check">
                    <input type="checkbox" class="form-check-input" id="bgmEnabled">
                    <label class="form-check-label">启用背景音乐</label>
                </div>
                <div class="form-check">
                    <input type="checkbox" class="form-check-input" id="sfxEnabled">
                    <label class="form-check-label">启用音效</label>
                </div>
            </div>
        </div>

        <!-- 界面设置 -->
        <div class="settings-card">
            <div class="card-header">
                <h5 class="settings-title"><i class="fas fa-desktop me-2"></i>界面设置</h5>
            </div>
            <div class="card-body">
                <div class="mb-3">
                    <label class="form-label">卡牌大小</label>
                    <select class="form-select" id="cardSize">
                        <option value="small">小</option>
                        <option value="medium">中</option>
                        <option value="large">大</option>
                    </select>
                </div>
                <div class="form-check">
                    <input type="checkbox" class="form-check-input" id="showTimer">
                    <label class="form-check-label">显示出牌计时器</label>
                </div>
                <div class="form-check">
                    <input type="checkbox" class="form-check-input" id="showCardCount">
                    <label class="form-check-label">显示剩余牌数</label>
                </div>
            </div>
        </div>

        <!-- 游戏设置 -->
        <div class="settings-card">
            <div class="card-header">
                <h5 class="settings-title"><i class="fas fa-gamepad me-2"></i>游戏设置</h5>
            </div>
            <div class="card-body">
                <div class="form-check">
                    <input type="checkbox" class="form-check-input" id="autoPass">
                    <label class="form-check-label">无法出牌时自动不出</label>
                </div>
                <div class="form-check">
                    <input type="checkbox" class="form-check-input" id="autoReady">
                    <label class="form-check-label">自动准备</label>
                </div>
            </div>
        </div>

        <button class="btn save-btn w-100" onclick="saveSettings()">
            <i class="fas fa-save me-2"></i>保存设置
        </button>
    </div>

    <script th:src="@{/js/lib/jquery.min.js}"></script>
    <script th:src="@{/js/lib/bootstrap.bundle.min.js}"></script>
    <script th:src="@{/js/common.js}"></script>
    <script th:src="@{/js/settings.js}"></script>
    <script th:src="@{/js/navbar.js}"></script>
</body>
</html> 